namespace Element
Description
A collection of shortcut methods that are added to all DOM elements.
Class methods
-
appear #
Element.appear(@element[, options]) -> elementMake an element appear by fading it in from 0% opacity.
This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.
-
cloneWithoutIDs #
Element.cloneWithoutIDs(@element) -> elementReturns a clone of the element with all
idattributed removed.This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.
-
effect #
Element.effect(@element, effect[, options]) -> elementInitialize and play the specified effect on the element.
This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.
-
fade #
Element.fade(@element[, options]) -> elementFade out an element from it's current opacity setting (or 100%).
This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.
-
getStyles #
Element.getStyles(@element) -> Object-
element(String|Object) – DOM object or element ID
Returns an object with all currently applied style attributes for a given DOM object. This includes all styles from stylesheets, properties set with style attributes and CSS properties set with the DOM API.
This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.
-
-
morph #
Element.morph(@element, style[, options]) -> elementDynamically adjust an element's CSS styles to the CSS properties given in the
styleargument.This method is the preferred way to invoke CSS-based effects:
Complex options can be specified with an Object literal:$('element_id').morph('width:500px'); $('element_id').morph('width:500px', 'slow'); $('element_id').morph('width:500px', function(){ alert('finished!'); }); $('element_id').morph('width:500px', 2); // duration 2 seconds
Morphs can be chained:$('element_id').morph('width:500px;height:500px', { duration: 4, transition: '', delay: .5, propertyTransitions: { width: 'mirror', height: 'easeInOutCirc' }, after: function(){ alert('finished'); } });
By default,// the height morph will be executed immediately following // the width morph $('element_id').morph('width:500px').morph('height:500px');
morphwill create a news2.fx.Queuefor the element if there isn't on already, and use this queue for queueing up chained morphs. To prevent a morph from queuing at the end, use theposition: 'parallel'option.See also// the height morph will be executed at the same time as the width morph $('element_id').morph('width:500px').morph('height:500px',{ position: 'parallel' });
s2.fx.Morph.This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.
-
scrollTo #
Element.scrollTo(@element[, to[, options]]) -> element-
to(Number) – vertical scroll position in pixels -
options(Object) – effect options
This method augments Prototype's Element.scrollTo method.
With just the
@elementparameter given, it will revert to Prototype's default implementation: the viewport will be scrolled (without animation) to contain the element.If given the
toparameter, the elements contents will be smoothly scrolled to the specified scrollTop position.This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.
-